<?php

class DB
{

	static $PDO = null;

	private static function dbConnect () {
		if (!isset (self::$PDO)) {
			self::$PDO = new PDO (DB_DSN, DB_USER, DB_PASSWORD);
			self::$PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		}
	}

	static function get () {
		self::dbConnect ();
		return self::$PDO;
	}
	
}
